package day018.thread.demo6;

public class Test3 {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (Test3.class) {
                    System.out.println("获取到锁，开始执行");
                    try {
                        System.out.println("进入计时等待...3秒");
                        Test3.class.wait(3000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println("自动唤醒。");
                }
            }
        }).start();
    }
}
